package com.yjd.comm.order.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.merchant.dto.EverPurchaseProjectDto;
import com.yjd.comm.order.model.OrderProjectModel;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：订单项目业务接口<br>
 * <b>time</b>：2017-06-27 08:54:10 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IOrderProjectService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public OrderProjectModel insert(OrderProjectModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(OrderProjectModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;

	/**
	 * 根据order id查询相关的所有project id
	 * Created by yangchangyan on 2017/8/22.
	 *
	 * @param
	 * @return
	 * @throws
	 */
	public List<Long> queryProjectId(Map<String,Object> param) throws Exception;

	/**
	 * 查询购买的项目记录，如：
	 * 1、根据user_id查询此用户曾经购买过的项目
	 * 2、根据order_id查询此订单包含哪些项目
	 * Created by yangchangyan on 2017/11/29.
	 *
	 * @param
	 * @return
	 * @throws
	 */
	public List<EverPurchaseProjectDto> everPurchaseProject(Map<String,Object> param) throws Exception;
}
